package com.kummuna.bl;

import java.io.InputStream;
import java.io.InputStreamReader;

import java.util.ArrayList;
import java.util.List;
 import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
import com.utilty.JSONParser;
 
import android.content.Context;


public class TopicBL {
	
	private JSONParser jsonParser;
	private static String URL="http://202.21.149.53/Gecko/api/waterleak";

	
	//constructor
	public TopicBL()
	{
		jsonParser=new JSONParser();
	}
	
	public JSONObject AddTopic(String topic,String detail,String userId)
	{
		List<NameValuePair> params=new ArrayList<NameValuePair>(); 
		params.add(new BasicNameValuePair("UserId",userId));
		params.add(new BasicNameValuePair("Topic",topic));
		params.add(new BasicNameValuePair("Detail",detail));
		
		
		JSONObject json=jsonParser.postJSONFromUrl(URL, params);
		return json;
	}
	
	
	

}